<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body {
      perspective: 500px;
      /*perspective-origin:500px 500px;*/
    }
    
    .box {
      position: relative;
      width: 200px;
      height: 200px;
      margin: 100px auto;
      transition: all 4s;
      /* 让子元素保持3d立体空间环境 */
      transform-style: preserve-3d;
      /* perspective: 500px; */
    }
    
    .box:hover {
      /* transform: rotateY(359deg); */
      transform: rotateX(-80deg);
    }
    
    .box div {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: #222;
      line-height: 200px;
      text-align: center;
      font-size: 40px;
      color: #fff;
      /* animation: div_2_ani 2s ease infinite; */
    }
    
    .box div:nth-child(1) {
      transform: rotateY(0deg) translateZ(100px);
    }
    
    .box div:nth-child(2) {
      transform: rotateY(90deg) translateZ(100px);
    }
    
    .box div:nth-child(3) {
      transform: rotateY(-90deg) translateZ(100px);
    }
    
    .box div:nth-child(4) {
      transform: rotateY(180deg) translateZ(100px);
    }
    
    @keyframes div_2_ani {
      0% {
        background-color: red;
      }
      100% {
        background-color: #222;
      }
    }
  </style>
</head>

<body>
  <div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
  </div>
</body>

</html>